#include <iostream>

class Base
{
public:
   virtual func()
   {
      std::cout << "Base::func()" << std::endl;
   }

private:
   int _a;
};

class Derive : public Base
{
public:
   virtual func()
   {
      std::cout << "Derive::func()" << std::endl;
   }

private:
   int _val;
};

int main()
{
   //Derive* d = new Derive();
   //std::cout << d << std::endl;
   //std::cout << (Base*)d << std::endl;
   Base* p = new Derive();
   p->func();

   return 0;
}
